package com.excel.controller;



import com.excel.service.TaskService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 批量导入日志信息表（提供导入日志查询功能） 前端控制器
 * </p>
 *
 *  @author hc
 * 
 */
@RestController
@RequestMapping("/excel")
@AllArgsConstructor
public class PubImpExcelJdLogController {

    @Autowired
    private TaskService importExcel;



    /**
     *
     * @param file      上传的excel文件
     * @param key        配置表的对应id
     * @param response      响应体对象
     */
    @RequestMapping(value = "/uploads",method = RequestMethod.POST)
    @ResponseBody
    public void importExcel(@RequestParam("file") MultipartFile file, String key, HttpServletResponse response) {
        importExcel.createTask(file, key);
    }

}
